package com.prs.crm.domain.cdxh.distribution;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import com.prs.crm.domain.BaseEntity;



/**
 * @author LanXiaoGang
 * @E-mail:lan9liang@163.com
 * @qq:7857553326
 * @version 创建时间：2011-1-10 上午10:02:19 简单说明
 */
@Entity
@Table(name = "cdxh_DistributionReturn")
public class DistributionReturn extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	/**
	 * 配送单明细
	 */
	@OneToMany(mappedBy = "distributionReturn")
	@Cascade({ org.hibernate.annotations.CascadeType.ALL,
			org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
	private Set<DistributionReturnDetail> details;
	
	/**
	 * 订单编号
	 * @param reOrderCode
	 */
	private String reOrderCode;
	
	/**
	 * 客户名称
	 * @param reCustomerName
	 */
	private String reCustomerName;
	
	/**
	 * 合计数量
	 * @param reToltalNum
	 */
	private int reToltalNum;
	
	/**
	 * 合计金额
	 * @param reToltalprice
	 */
	private Double reToltalprice;
	
	
	/**
	 * 该单据配送打回状态
	 * @param redisSate
	 */
	private int redisSate;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Set<DistributionReturnDetail> getDetails() {
		return details;
	}

	public void setDetails(Set<DistributionReturnDetail> details) {
		this.details = details;
	}

	public String getReOrderCode() {
		return reOrderCode;
	}

	public void setReOrderCode(String reOrderCode) {
		this.reOrderCode = reOrderCode;
	}

	public String getReCustomerName() {
		return reCustomerName;
	}

	public void setReCustomerName(String reCustomerName) {
		this.reCustomerName = reCustomerName;
	}
	
	public int getReToltalNum() {
		return reToltalNum;
	}

	public void setReToltalNum(int reToltalNum) {
		this.reToltalNum = reToltalNum;
	}

	public Double getReToltalprice() {
		return reToltalprice;
	}

	public void setReToltalprice(Double reToltalprice) {
		this.reToltalprice = reToltalprice;
	}

	public int getRedisSate() {
		return redisSate;
	}

	public void setRedisSate(int redisSate) {
		this.redisSate = redisSate;
	}

	public void addDetail(DistributionReturnDetail detail) {
		if (details == null)
			details = new HashSet<DistributionReturnDetail>();
		detail.setDistributionReturn(this);
		details.add(detail);
	}
}
